#include <bits/stdc++.h>
using namespace std;
const int N = 5e4 + 10;

int n, q, a[N];

int main()
{
	cin >> n >> q;
	int t = 0;
	for(int i = 1;i <= n;i ++)
	{
		int x; cin >> x;
		a[i] = t;
		t += x;
	}
	while(q --)
	{
		int x; cin >> x;
		int l = 1, r = n;
		while(l < r)
		{
			int mid = l + r + 1 >> 1;
			if(a[mid] <= x) l = mid;
			else r = mid - 1;
		}
		cout << l << endl;
	}
	return 0;
}